home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / mg2a_src.zip / SYS / VMS / CCOM.COM < prev    next >
Text File  |  1988-08-23  |  1KB  |  53 lines

  1. $    Verify = F$Verify(0)
  2. $!
  3. $! CCOM.COM
  4. $!
  5. $!    Run the C compiler on P1, but only if the .c file
  6. $!    is newer than the corresponding .obj file.
  7. $!
  8. $! Usage:
  9. $!    @CCOM [file [qualifiers]]
  10. $!
  11. $    If P1 .Eqs. "" Then -
  12.         Inquire P1 "C Source File"
  13. $    Name = P1 - ".C"
  14. $    Source = Name + ".C"
  15. $    Object = f$parse(P1,,,"NAME") + ".OBJ"
  16. $!
  17. $! See if both files exist.  If both exist, only compile the
  18. $! source if the revision date is greater than or equal to
  19. $! that of the object file.
  20. $!
  21. $    If F$Search(Source) .Eqs. "" Then -
  22.         Goto NoSource
  23. $    If F$Search(Object) .Eqs. "" Then -
  24. $        Goto Compile
  25. $    SDate = F$File_Attributes(Source, "RDT")
  26. $    ODate = F$File_Attributes(Object, "RDT") 
  27. $    If SDate .Lts. ODate Then -
  28.         Goto Bye
  29. $!
  30. $! Compile the program
  31. $!
  32. $Compile:
  33. $    On Error Then Goto Fail
  34. $    Write Sys$Output "Compiling " + Source
  35. $    CC 'P2' 'Source
  36. $    If F$Search(Object) .Eqs. "" Then -
  37.         Goto Fail
  38. $!
  39. $! Done.
  40. $!
  41. $Bye:
  42. $    If Verify Then    Set Verify
  43. $    Exit
  44. $!
  45. $NoSource:
  46. $    Write Sys$Output "%CCOM-F-NOTFOUND, file not found"
  47. $    Goto Bye
  48. $!
  49. $Fail:
  50. $    Write Sys$Output "%CCOM-F-FAIL, compile failed"
  51. $    Goto Bye
  52.  
  53.